﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VirtualRink.Library
{
	public class StandingsComparer : IComparer<Standing>
	{
		public int Compare(Standing item1, Standing item2)
		{
			if (item1.Points != item2.Points)
				return item1.Points - item2.Points;

			if (item1.Wins != item2.Wins)
				return item1.Wins - item2.Wins;

			if (item1.Losses != item2.Losses)
				return item2.Losses - item1.Losses;

			return item2.Ties - item1.Ties;

		}
	}
}
